{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\nmatsumura\Desktop\MLM Replication\MattesLeedsMatsumuraJPRReplication_Nov2015_3-4.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}25 Nov 2015, 18:46:00

{com}. do "C:\Users\NMATSU~1\AppData\Local\Temp\STD04000000.tmp"
{txt}
{com}. *** This is the replication do-file for "Measuring Change in Source of Leader Support:  The CHISOLS Dataset" by Mattes, Leeds, and Matsumura. (Created on Nov. 25, 2015) 
. *** The complete and most recent version of the CHISOLS data is available at www.chisols.org. 
. clear
{txt}
{com}. set more off
{txt}
{com}. 
. *** BASIC DESCRIPTIVES FOR CHISOLS STATE-YEAR DATA (Section 3 of the article)
. use "MattesLeedsMatsumuraJPR1_3-4.dta",replace  
{txt}(Database of Political Institutions 2012. Philip Keefer, World Bank)

{com}. drop if  _m==1 /* This data set was created from merging CHISOLS and DPI2012. For basic descriptives, we keep observations in CHISOLS only*/
{txt}(1651 observations deleted)

{com}. 
. ** Number of nonconsolidated regimes
. tab noncon 

  {txt}Dummy for {c |}
non-consoli {c |}
      dated {c |}
    regime: {c |}
 coded 1 if {c |}
 other=1 or {c |}
  warlord=1 {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      9,070       93.48       93.48
{txt}          1 {c |}{res}        633        6.52      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      9,703      100.00
{txt}
{com}. 
. ** Number of observations
. sum ccode  

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
{space 7}ccode {c |}{res}      9703    435.9097    249.8737          2        950
{txt}
{com}. 
. ** Number of countries
. by ccode, sort: gen num=_n==1 
{txt}
{com}. count if num==1 
{res}  169
{txt}
{com}. 
. ** Number of regime types
. tab dem 

  {txt}Codes whether {c |}
   the state is {c |}
 democractic in {c |}
       the year {c |}      Freq.     Percent        Cum.
{hline 16}{c +}{hline 35}
Transition Year {c |}{res}         15        0.15        0.15
{txt}              0 {c |}{res}      5,961       61.43       61.59
{txt}              1 {c |}{res}      3,727       38.41      100.00
{txt}{hline 16}{c +}{hline 35}
          Total {c |}{res}      9,703      100.00
{txt}
{com}. 
. ** Number of leader transitions
. tab leadertrans 

      {txt}Codes {c |}
    whether {c |}
there was a {c |}
     leader {c |}
 transition {c |}
in the year {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      7,832       80.72       80.72
{txt}          1 {c |}{res}      1,871       19.28      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      9,703      100.00
{txt}
{com}. 
. ** Number of SOLS changes
. * NOTE: We treat minor SOLS changes in nondemocracies as SOLS changes.
. * In doing so, we don't count the following three (four) nondemocratic minor SOLS changes.
. * Belgium(211) in 1939: two minor SOLS changes are in nondemocratic period but there is also a major SOLS change. 
. * Sudan(625) in 1989: minor SOLS change is in nondemocratic period but there is also a major SOLS change. 
. * Fiji(950) in 2006: minor SOLS change is in nondemocratic period but there is also a major SOLS change. 
. * We generate a new variable that codes nondemocratic minor SOLS changes that can be added to existing SOLS changes
. gen solsminnondem=0
{txt}
{com}. replace solsminnondem=1 if solsminchange==1 & dem==0
{txt}(34 real changes made)

{com}. replace solsminnondem=0 if ccode==211 & year==1939
{txt}(0 real changes made)

{com}. replace solsminnondem=0 if ccode==625 & year==1989
{txt}(1 real change made)

{com}. replace solsminnondem=0 if ccode==950 & year==2006
{txt}(1 real change made)

{com}. replace solschange= solschange + solsminnondem 
{txt}(32 real changes made)

{com}. replace solschdum=1 if solsminnondem==1
{txt}(30 real changes made)

{com}. tab solschdum if leadertrans==1

  {txt}Dummy for {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        949       50.72       50.72
{txt}          1 {c |}{res}        922       49.28      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,871      100.00
{txt}
{com}. 
. ** Maximum mumber of leader transitions in a year
. sum leadertransnum

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
leadertran~m {c |}{res}      9703    .2387921    .5517647          0          7
{txt}
{com}. 
. ** Maximum number of SOLS changes in a year
. sum solschange

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
{space 2}solschange {c |}{res}      9703     .101515    .3240844          0          3
{txt}
{com}. 
. ** Average number of leader transitions per year 
. by ccode: egen leadertranstotalN= total(leadertransnum)
{txt}
{com}. by ccode: egen yearstotal= count(year)
{txt}
{com}. gen ldrtransavgN=leadertranstotalN/yearstotal
{txt}
{com}. egen maxldrtransavgN= max(ldrtransavgN)
{txt}
{com}. tab ccode if maxldrtransavgN==ldrtransavgN /* Swizerland(225) and Bosnia-Herzegovia(346) */

{txt}COW country {c |}
       code {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
        225 {c |}{res}         90       84.11       84.11
{txt}        346 {c |}{res}         17       15.89      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        107      100.00
{txt}
{com}. egen minldrtransavgN= min(ldrtransavgN)
{txt}
{com}. tab ccode if minldrtransavgN==ldrtransavgN /* e.g., Oman(698) and Uzbekistan(704) */

{txt}COW country {c |}
       code {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
        347 {c |}{res}          1        1.06        1.06
{txt}        679 {c |}{res}         19       20.21       21.28
{txt}        698 {c |}{res}         38       40.43       61.70
{txt}        704 {c |}{res}         18       19.15       80.85
{txt}        705 {c |}{res}         18       19.15      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}         94      100.00
{txt}
{com}. 
. ** Average number of SOLS changes per year 
. by ccode: egen solschtotalN=total(solschange)
{txt}
{com}. gen solschavgN= solschtotalN/yearstotal
{txt}
{com}. egen maxsolschavgN= max(solschavgN)
{txt}
{com}. tab ccode if maxsolschavgN==solschavgN  /* France(220) */

{txt}COW country {c |}
       code {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
        220 {c |}{res}         89      100.00      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}         89      100.00
{txt}
{com}. sum maxsolschavgN if ccode==220

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
maxsolscha~N {c |}{res}        89    .5280899           0   .5280899   .5280899
{txt}
{com}. egen minsolschavgN= min(solschavgN) if ldrtransavg!=0
{txt}(94 missing values generated)

{com}. tab ccode if minsolschavgN==solschavgN  /* e.g., Bhutan(760) and Tanzania(510) */

{txt}COW country {c |}
       code {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
        225 {c |}{res}         90        7.85        7.85
{txt}        265 {c |}{res}         37        3.23       11.08
{txt}        341 {c |}{res}          3        0.26       11.34
{txt}        411 {c |}{res}         41        3.58       14.92
{txt}        481 {c |}{res}         49        4.28       19.20
{txt}        510 {c |}{res}         48        4.19       23.39
{txt}        522 {c |}{res}         32        2.79       26.18
{txt}        531 {c |}{res}         16        1.40       27.57
{txt}        540 {c |}{res}         34        2.97       30.54
{txt}        541 {c |}{res}         34        2.97       33.51
{txt}        565 {c |}{res}         19        1.66       35.17
{txt}        571 {c |}{res}         43        3.75       38.92
{txt}        572 {c |}{res}         41        3.58       42.50
{txt}        600 {c |}{res}         53        4.62       47.12
{txt}        663 {c |}{res}         63        5.50       52.62
{txt}        670 {c |}{res}         82        7.16       59.77
{txt}        680 {c |}{res}         24        2.09       61.87
{txt}        690 {c |}{res}         48        4.19       66.06
{txt}        692 {c |}{res}         38        3.32       69.37
{txt}        694 {c |}{res}         38        3.32       72.69
{txt}        696 {c |}{res}         38        3.32       76.00
{txt}        701 {c |}{res}         18        1.57       77.57
{txt}        731 {c |}{res}         61        5.32       82.90
{txt}        760 {c |}{res}         38        3.32       86.21
{txt}        816 {c |}{res}         55        4.80       91.01
{txt}        820 {c |}{res}         52        4.54       95.55
{txt}        830 {c |}{res}         44        3.84       99.39
{txt}        860 {c |}{res}          7        0.61      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,146      100.00
{txt}
{com}.            
. ** Leader change and SOLS change by regime type
. tab leadertrans if dem==1 

      {txt}Codes {c |}
    whether {c |}
there was a {c |}
     leader {c |}
 transition {c |}
in the year {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,707       72.63       72.63
{txt}          1 {c |}{res}      1,020       27.37      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,727      100.00
{txt}
{com}. tab solschdum if dem==1 & leadertrans==1 

  {txt}Dummy for {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        449       44.02       44.02
{txt}          1 {c |}{res}        571       55.98      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,020      100.00
{txt}
{com}. tab leadertrans if dem==0 

      {txt}Codes {c |}
    whether {c |}
there was a {c |}
     leader {c |}
 transition {c |}
in the year {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      5,117       85.84       85.84
{txt}          1 {c |}{res}        844       14.16      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      5,961      100.00
{txt}
{com}. tab solschdum if dem==0 & leadertrans==1 

  {txt}Dummy for {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        498       59.00       59.00
{txt}          1 {c |}{res}        346       41.00      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        844      100.00
{txt}
{com}. 
. ** Relationship between SOLS change and regime transitions (i.e., dem to nondem and vice versa) in all state-years
. tab solschdum if regtrans==1 

  {txt}Dummy for {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}         92       43.81       43.81
{txt}          1 {c |}{res}        118       56.19      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        210      100.00
{txt}
{com}. tab solschdum if regtrans==1 & leadertrans==1

  {txt}Dummy for {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}         17       12.69       12.69
{txt}          1 {c |}{res}        117       87.31      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        134      100.00
{txt}
{com}. tab regtrans if solschdum==1 

      {txt}Codes {c |}
whether the {c |}
regime type {c |}
     of the {c |}
      state {c |}
 changed in {c |}
   the year {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        806       87.23       87.23
{txt}          1 {c |}{res}        118       12.77      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        924      100.00
{txt}
{com}. 
. ** TABLE I: Overlap of SOLS changes and regime transitions in CHISOLS state-year data
. ** Differentiate SOLS change, leader transition, and no leader transition years
. gen othleadtrans=leadertrans /* This is a dummy variable capturing a leader transition that is not accompanied by a SOLS change */
{txt}
{com}. replace othleadtrans=0 if solschdum==1
{txt}(922 real changes made)

{com}. 
. gen leadtranstype=0
{txt}
{com}. replace leadtranstype=1 if othleadtrans==1
{txt}(949 real changes made)

{com}. replace leadtranstype=2 if solschdum==1
{txt}(924 real changes made)

{com}. tab leadtranstype if regtrans==1   

{txt}leadtransty {c |}
         pe {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}         75       35.71       35.71
{txt}          1 {c |}{res}         17        8.10       43.81
{txt}          2 {c |}{res}        118       56.19      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        210      100.00
{txt}
{com}. tab leadtranstype if regtrans==0   

{txt}leadtransty {c |}
         pe {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      7,755       81.69       81.69
{txt}          1 {c |}{res}        932        9.82       91.51
{txt}          2 {c |}{res}        806        8.49      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      9,493      100.00
{txt}
{com}. tab regtrans leadtranstype , col row chi2 V
{txt}
{c TLC}{hline 19}{c TRC}
{c |} Key{col 21}{c |}
{c LT}{hline 19}{c RT}
{c |}{space 5}{it:frequency}{col 21}{c |}
{c |}{space 2}{it:row percentage}{col 21}{c |}
{c |}{space 1}{it:column percentage}{col 21}{c |}
{c BLC}{hline 19}{c BRC}

     Codes {c |}
   whether {c |}
the regime {c |}
   type of {c |}
 the state {c |}
changed in {c |}          leadtranstype
  the year {c |}         0          1          2 {c |}     Total
{hline 11}{c +}{hline 33}{c +}{hline 10}
         0 {c |}{res}     7,755        932        806 {txt}{c |}{res}     9,493 
           {txt}{c |}{res}     81.69       9.82       8.49 {txt}{c |}{res}    100.00 
           {txt}{c |}{res}     99.04      98.21      87.23 {txt}{c |}{res}     97.84 
{txt}{hline 11}{c +}{hline 33}{c +}{hline 10}
         1 {c |}{res}        75         17        118 {txt}{c |}{res}       210 
           {txt}{c |}{res}     35.71       8.10      56.19 {txt}{c |}{res}    100.00 
           {txt}{c |}{res}      0.96       1.79      12.77 {txt}{c |}{res}      2.16 
{txt}{hline 11}{c +}{hline 33}{c +}{hline 10}
     Total {c |}{res}     7,830        949        924 {txt}{c |}{res}     9,703 
           {txt}{c |}{res}     80.70       9.78       9.52 {txt}{c |}{res}    100.00 
           {txt}{c |}{res}    100.00     100.00     100.00 {txt}{c |}{res}    100.00 

{txt}          Pearson chi2({res}2{txt}) = {res}545.3383  {txt} Pr = {res}0.000
{txt}               Cram{c e'}r's V = {res}  0.2371
{txt}
{com}. 
. 
. *** BASIC DESCRIPTIVES FOR CHISOLS LEADER-LEVEL DATA (Section 3 the article)
. use "MattesLeedsMatsumuraJPR2_3-4.dta",clear  
{txt}
{com}. 
. ** Number of unique spell
. sum ccode 

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
{space 7}ccode {c |}{res}      2412    386.2989    251.4367          2        950
{txt}
{com}. 
. ** Number of unique spells that CHISOLS has information on
. sum ccode if year~=.

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
{space 7}ccode {c |}{res}      2305    384.7137    252.0267          2        950
{txt}
{com}. 
. ** Number of SOLS changes (NOTE: we treat minor SOLS changes in nondemocracies as SOLS changes)
. replace solschange=1 if solsminchinit==1 & dem==0
{txt}(32 real changes made)

{com}. replace solsminchinit=0 if dem==0
{txt}(32 real changes made)

{com}. tab solschange 

      {txt}Codes {c |}
whether the {c |}
leader came {c |}
   to power {c |}
      via a {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,281       55.57       55.57
{txt}          1 {c |}{res}      1,024       44.43      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,305      100.00
{txt}
{com}. tab solsminchinit if dem==1 

      {txt}Codes {c |}
whether the {c |}
leader came {c |}
   to power {c |}
via a minor {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,141       93.45       93.45
{txt}          1 {c |}{res}         80        6.55      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,221      100.00
{txt}
{com}. 
. ** Number of minor SOLS changes during leader tenures
. gen solsminchdurdum=0
{txt}
{com}. replace solsminchdurdum=1 if solsminchdur!=0
{txt}(150 real changes made)

{com}. tab solsminchdurdum 

{txt}solsminchdu {c |}
       rdum {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,262       93.78       93.78
{txt}          1 {c |}{res}        150        6.22      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,412      100.00
{txt}
{com}. sum solsminchdur 

{txt}    Variable {c |}       Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 56}
solsminchdur {c |}{res}      2412    .1053068    .5878812          0         17
{txt}
{com}. 
. ** Number of interim leaders
. tab interim 

  {txt}Dummy for {c |}
    interim {c |}
     leader {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,202       91.29       91.29
{txt}          1 {c |}{res}        210        8.71      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,412      100.00
{txt}
{com}. tab dem if interim==1 

  {txt}Codes whether {c |}
   the state is {c |}
 democractic in {c |}
       the year {c |}      Freq.     Percent        Cum.
{hline 16}{c +}{hline 35}
Transition Year {c |}{res}          2        0.97        0.97
{txt}              0 {c |}{res}         96       46.38       47.34
{txt}              1 {c |}{res}        109       52.66      100.00
{txt}{hline 16}{c +}{hline 35}
          Total {c |}{res}        207      100.00
{txt}
{com}. tab regtrans if interim==1 

      {txt}Codes {c |}
whether the {c |}
regime type {c |}
     of the {c |}
      state {c |}
 changed in {c |}
   the year {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        186       89.86       89.86
{txt}          1 {c |}{res}         21       10.14      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        207      100.00
{txt}
{com}. 
. ** Number of leader transitions where we used the pre-designated successor rule
. tab predes 

{txt}Pre-designa {c |}
        ted {c |}
 successor: {c |}
 coded 1 if {c |}
 interim==0 {c |}
 & other==1 {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,205       91.42       91.42
{txt}          1 {c |}{res}        207        8.58      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,412      100.00
{txt}
{com}. tab solschange if predes==1 

      {txt}Codes {c |}
whether the {c |}
leader came {c |}
   to power {c |}
      via a {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}         66       31.88       31.88
{txt}          1 {c |}{res}        141       68.12      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        207      100.00
{txt}
{com}. 
. *** CHISOLS VS. ARCHIGOS COMPARISON (Section 5 of manuscript)
. ** Contrast irregular entry and SOLS change (NOTE: we consider foreign imposition as irregular entry)
. gen entry2 = .
{txt}(2412 missing values generated)

{com}. replace entry2 = 0 if entry=="Regular"
{txt}(1938 real changes made)

{com}. replace entry2 = 1 if entry=="Irregular"
{txt}(433 real changes made)

{com}. replace entry2 = 2 if entry=="Foreign Imposition"
{txt}(24 real changes made)

{com}. replace entry2 = 3 if entry=="Still in Office"
{txt}(0 real changes made)

{com}. replace entry2 = 4 if entry=="Unknown"
{txt}(0 real changes made)

{com}. label define entrytype 0 "Regular" 1 "Irregular" 2 "Foreign Imposition" 3 "Still in Office" 4 "Unknown"
{txt}
{com}. label values entry2 entrytype
{txt}
{com}. codebook entry2 entry

{txt}{hline}
{res}entry2{right:(unlabeled)}
{txt}{hline}

{col 19}type:  numeric ({res}float{txt})
{ralign 22:label}:  {res:entrytype}

{col 18}range:  [{res}0{txt},{res}2{txt}]{col 55}units:  {res}1
{col 10}{txt}unique values:  {res}3{col 51}{txt}missing .:  {res}17{txt}/{res}2412

{txt}{col 13}tabulation:  Freq.   Numeric  Label
{col 24}{res}   1938{col 33}       0{col 43}{txt}Regular
{col 24}{res}    433{col 33}       1{col 43}{txt}Irregular
{col 24}{res}     24{col 33}       2{col 43}{txt}Foreign Imposition
{col 24}{res}     17{col 33}       .{col 43}

{txt}{hline}
{res}entry{right:Archigos entry v.4.0}
{txt}{hline}

{col 19}type:  string ({res}str18{txt})

{col 10}unique values:  {res}3{col 51}{txt}missing "":  {res}17{txt}/{res}2412

{txt}{col 13}tabulation:  Freq.  Value
{col 24}{res}     17{col 33}""
{col 24}     24{col 33}"Foreign Imposition"
{col 24}    433{col 33}"Irregular"
{col 24}   1938{col 33}"Regular"

{txt}{col 16}warning:  variable has embedded blanks

{com}. 
. recode entry2 (2=1)
{txt}(entry2: 24 changes made)

{com}. tab solschange if entry2==1   

      {txt}Codes {c |}
whether the {c |}
leader came {c |}
   to power {c |}
      via a {c |}
 solschange {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        201       46.21       46.21
{txt}          1 {c |}{res}        234       53.79      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        435      100.00
{txt}
{com}. tab entry2 solschange if dem==1, col 
{txt}
{c TLC}{hline 19}{c TRC}
{c |} Key{col 21}{c |}
{c LT}{hline 19}{c RT}
{c |}{space 5}{it:frequency}{col 21}{c |}
{c |}{space 1}{it:column percentage}{col 21}{c |}
{c BLC}{hline 19}{c BRC}

                   {c |}   Codes whether the
                   {c |} leader came to power
                   {c |}   via a solschange
            entry2 {c |}         0          1 {c |}     Total
{hline 19}{c +}{hline 22}{c +}{hline 10}
           Regular {c |}{res}       560        610 {txt}{c |}{res}     1,170 
                   {txt}{c |}{res}     97.05      96.83 {txt}{c |}{res}     96.93 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
         Irregular {c |}{res}        17         20 {txt}{c |}{res}        37 
                   {txt}{c |}{res}      2.95       3.17 {txt}{c |}{res}      3.07 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
             Total {c |}{res}       577        630 {txt}{c |}{res}     1,207 
                   {txt}{c |}{res}    100.00     100.00 {txt}{c |}{res}    100.00 

{txt}
{com}. tab entry2 solschange if dem==0, col 
{txt}
{c TLC}{hline 19}{c TRC}
{c |} Key{col 21}{c |}
{c LT}{hline 19}{c RT}
{c |}{space 5}{it:frequency}{col 21}{c |}
{c |}{space 1}{it:column percentage}{col 21}{c |}
{c BLC}{hline 19}{c BRC}

                   {c |}   Codes whether the
                   {c |} leader came to power
                   {c |}   via a solschange
            entry2 {c |}         0          1 {c |}     Total
{hline 19}{c +}{hline 22}{c +}{hline 10}
           Regular {c |}{res}       508        172 {txt}{c |}{res}       680 
                   {txt}{c |}{res}     73.52      44.91 {txt}{c |}{res}     63.31 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
         Irregular {c |}{res}       183        211 {txt}{c |}{res}       394 
                   {txt}{c |}{res}     26.48      55.09 {txt}{c |}{res}     36.69 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
             Total {c |}{res}       691        383 {txt}{c |}{res}     1,074 
                   {txt}{c |}{res}    100.00     100.00 {txt}{c |}{res}    100.00 

{txt}
{com}. 
. 
. ** TABLE II: Comparison of Archigos and CHISOLS, 1919-2004
. ** Contrast irregular entry and solschange 
. tab entry2 solschange, row  chi2 V 
{txt}
{c TLC}{hline 16}{c TRC}
{c |} Key{col 18}{c |}
{c LT}{hline 16}{c RT}
{c |}{space 3}{it:frequency}{col 18}{c |}
{c |}{space 1}{it:row percentage}{col 18}{c |}
{c BLC}{hline 16}{c BRC}

                   {c |}   Codes whether the
                   {c |} leader came to power
                   {c |}   via a solschange
            entry2 {c |}         0          1 {c |}     Total
{hline 19}{c +}{hline 22}{c +}{hline 10}
           Regular {c |}{res}     1,069        786 {txt}{c |}{res}     1,855 
                   {txt}{c |}{res}     57.63      42.37 {txt}{c |}{res}    100.00 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
         Irregular {c |}{res}       201        234 {txt}{c |}{res}       435 
                   {txt}{c |}{res}     46.21      53.79 {txt}{c |}{res}    100.00 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
             Total {c |}{res}     1,270      1,020 {txt}{c |}{res}     2,290 
                   {txt}{c |}{res}     55.46      44.54 {txt}{c |}{res}    100.00 

{txt}          Pearson chi2({res}1{txt}) = {res} 18.6073  {txt} Pr = {res}0.000
{txt}               Cram{c e'}r's V = {res}  0.0901
{txt}
{com}. ** Contrast irregular entry and solschange by regime type
. tab entry2 solschange if dem==1, row  chi2 V 
{txt}
{c TLC}{hline 16}{c TRC}
{c |} Key{col 18}{c |}
{c LT}{hline 16}{c RT}
{c |}{space 3}{it:frequency}{col 18}{c |}
{c |}{space 1}{it:row percentage}{col 18}{c |}
{c BLC}{hline 16}{c BRC}

                   {c |}   Codes whether the
                   {c |} leader came to power
                   {c |}   via a solschange
            entry2 {c |}         0          1 {c |}     Total
{hline 19}{c +}{hline 22}{c +}{hline 10}
           Regular {c |}{res}       560        610 {txt}{c |}{res}     1,170 
                   {txt}{c |}{res}     47.86      52.14 {txt}{c |}{res}    100.00 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
         Irregular {c |}{res}        17         20 {txt}{c |}{res}        37 
                   {txt}{c |}{res}     45.95      54.05 {txt}{c |}{res}    100.00 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
             Total {c |}{res}       577        630 {txt}{c |}{res}     1,207 
                   {txt}{c |}{res}     47.80      52.20 {txt}{c |}{res}    100.00 

{txt}          Pearson chi2({res}1{txt}) = {res}  0.0528  {txt} Pr = {res}0.818
{txt}               Cram{c e'}r's V = {res}  0.0066
{txt}
{com}. tab entry2 solschange if dem==0, row  chi2 V 
{txt}
{c TLC}{hline 16}{c TRC}
{c |} Key{col 18}{c |}
{c LT}{hline 16}{c RT}
{c |}{space 3}{it:frequency}{col 18}{c |}
{c |}{space 1}{it:row percentage}{col 18}{c |}
{c BLC}{hline 16}{c BRC}

                   {c |}   Codes whether the
                   {c |} leader came to power
                   {c |}   via a solschange
            entry2 {c |}         0          1 {c |}     Total
{hline 19}{c +}{hline 22}{c +}{hline 10}
           Regular {c |}{res}       508        172 {txt}{c |}{res}       680 
                   {txt}{c |}{res}     74.71      25.29 {txt}{c |}{res}    100.00 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
         Irregular {c |}{res}       183        211 {txt}{c |}{res}       394 
                   {txt}{c |}{res}     46.45      53.55 {txt}{c |}{res}    100.00 
{txt}{hline 19}{c +}{hline 22}{c +}{hline 10}
             Total {c |}{res}       691        383 {txt}{c |}{res}     1,074 
                   {txt}{c |}{res}     64.34      35.66 {txt}{c |}{res}    100.00 

{txt}          Pearson chi2({res}1{txt}) = {res} 86.8264  {txt} Pr = {res}0.000
{txt}               Cram{c e'}r's V = {res}  0.2843
{txt}
{com}. 
. 
. *** CHISOLS VS. DPI COMPARISON (Section 5 the article)
. * Since DPI2012 does not include leader names and dates of entry, we conduct this comparison based on the following assumptions:  
. * First, we assume that DPI2012 and CHISOLS code the same leader(s) and entry date(s) in a given year as long as both data sets agree on the role of the chief executive (e.g., President).  
. * Second, we assume that the entry of a new executive corresponds to the start of a new executive party orientation. 
. * Third, if there are two or more leaders in a given year, we assume DPI2012 codes the party orientation of the first leader unless there is a January leader transition, in which case we assume DPI codes the party orientation of the leader who comes to power in January.  
. * Fourth, if DPI2012 does not code a left-right party orientation or the observation is missing, we code 'no information'.
. use "MattesLeedsMatsumuraJPR1_3-4.dta",replace  /* open state-year data */
{txt}(Database of Political Institutions 2012. Philip Keefer, World Bank)

{com}. 
. * NOTE: We treat minor SOLS changes in nondemocracies as major SOLS changes (see above)
. gen solsminnondem=0
{txt}
{com}. replace solsminnondem=1 if solsminchange==1 & dem==0
{txt}(34 real changes made)

{com}. replace solsminnondem=0 if ccode==211 & year==1939
{txt}(0 real changes made)

{com}. replace solsminnondem=0 if ccode==625 & year==1989
{txt}(1 real change made)

{com}. replace solsminnondem=0 if ccode==950 & year==2006
{txt}(1 real change made)

{com}. replace solschange= solschange + solsminnondem 
{txt}(32 real changes made)

{com}. replace solschdum=1 if solsminnondem==1
{txt}(30 real changes made)

{com}. 
. * The following commands change the data to make CHISOLS comparable to DPI2012.
. * For leader/SOLS changes that occured in January, we use leader/SOLS changes in the previous year. 
. * This is because DPI codes the executive ideology of a leader who came to power in Jan. (not a leader who left power in Jan.).  
. * For example, DPI codes "right" for G.W. Bush in 1992 and "left" for Clinton in 1993. G.W. Bush was in power until Jan. 21, 1993. 
. * Accordingly, this shift is coded in 1992. However, CHISOLS codes the SOLS change and lists the leader as "Bush G., Clinton" in 1993.
. sort ccode year   
{txt}
{com}. replace solschmo1=1 if solschmo1==. & solschmo2==1 /* fix if the 2nd (3rd ...) leader transtion is a SOLS change and occurs in Jan. */   
{txt}(4 real changes made)

{com}. bysort ccode: replace solschdum = 1 if solschmo1[_n+1]==1 & solschange~=.
{txt}(79 real changes made)

{com}. bysort ccode: replace solschdum = 0 if solschmo1==1 & solschange~=.
{txt}(90 real changes made)

{com}. bysort ccode: replace solschdum = 1 if solsminchmo1[_n+1]==1 & solsminchange~=. & dem==0
{txt}(4 real changes made)

{com}. bysort ccode: replace solschdum = 0 if solsminchmo1==1 & solsminchange~=. & dem==0       
{txt}(4 real changes made)

{com}. 
. replace solschdum = 1 if ccode==370 & year==1994 /* deal with cases that have both a January SOLS change and a non-January SOLS change in a given year. */ 
{txt}(1 real change made)

{com}. replace solschdum = 1 if ccode==372 & year==1992 
{txt}(1 real change made)

{com}.                                                                          
. ** Cases in which DPI has no info or is missing in L-R shift (NOTE: we drop obs in 2008 since CHISOLS doesn't have leader/sols change that occurs Jan. in 2009.(p.14) 
. tab execrlc2 if year<=2008 & year>=1975

   {txt}Modified {c |}
      Chief {c |}
  Executive {c |}
       Pary {c |}
Orientation {c |}
  :Economic {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
       -999 {c |}{res}        547        9.04        9.04
{txt}          0 {c |}{res}      2,127       35.15       44.18
{txt}          1 {c |}{res}      1,205       19.91       64.09
{txt}          2 {c |}{res}        359        5.93       70.03
{txt}          3 {c |}{res}      1,814       29.97      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      6,052      100.00
{txt}
{com}. dis (547+2127)/6052 
{res}.44183741
{txt}
{com}. tab execrlc2 dem if year<=2008 & year>=1975

  {txt}Modified {c |}
     Chief {c |}
 Executive {c |}
      Pary {c |}    Codes whether the state is
Orientatio {c |}     democractic in the year
n:Economic {c |} Transitio          0          1 {c |}     Total
{hline 11}{c +}{hline 33}{c +}{hline 10}
      -999 {c |}{res}         0         45         56 {txt}{c |}{res}       101 
{txt}         0 {c |}{res}         0      1,654        360 {txt}{c |}{res}     2,014 
{txt}         1 {c |}{res}         0        242        791 {txt}{c |}{res}     1,033 
{txt}         2 {c |}{res}         0         43        221 {txt}{c |}{res}       264 
{txt}         3 {c |}{res}         1        920        780 {txt}{c |}{res}     1,701 
{txt}{hline 11}{c +}{hline 33}{c +}{hline 10}
     Total {c |}{res}         1      2,904      2,208 {txt}{c |}{res}     5,113 

{txt}
{com}. dis (45+1654)/((45+1654) + (56+360))               
{res}.80330969
{txt}
{com}. 
. ** Cases in which DPI has no info or is missing in L-R shift and CHISOLS codes SOLS change
. tab econ_shift dem  if solschdum==1 & _m==3 & (year<2008 & year>=1975)  

                      {txt}{c |}   Codes whether the
       Shift in Chief {c |} state is democractic
            Executive {c |}      in the year
       Party:Economic {c |}         0          1 {c |}     Total
{hline 22}{c +}{hline 22}{c +}{hline 10}
  -999: no info or NA {c |}{res}        63         38 {txt}{c |}{res}       101 
{txt}    0:no shift in L-R {c |}{res}        21         73 {txt}{c |}{res}        94 
{txt}       1:shift in L-R {c |}{res}         9        141 {txt}{c |}{res}       150 
{txt} 999: shift no t/f L- {c |}{res}        44         64 {txt}{c |}{res}       108 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
                Total {c |}{res}       137        316 {txt}{c |}{res}       453 

{txt}
{com}. dis 63/101 
{res}.62376238
{txt}
{com}.                            
. ** Association between SOLS change and DPI's economic ideology shift for cases in which DPI has L-R info 
. tab econ_shift solschdum  if _m==3 & (year<2008 & year>=1975) & (econ_shift==0|econ_shift==1), row colum chi2 V 
{txt}
{c TLC}{hline 19}{c TRC}
{c |} Key{col 21}{c |}
{c LT}{hline 19}{c RT}
{c |}{space 5}{it:frequency}{col 21}{c |}
{c |}{space 2}{it:row percentage}{col 21}{c |}
{c |}{space 1}{it:column percentage}{col 21}{c |}
{c BLC}{hline 19}{c BRC}

       Shift in Chief {c |}
            Executive {c |} Dummy for solschange
       Party:Economic {c |}         0          1 {c |}     Total
{hline 22}{c +}{hline 22}{c +}{hline 10}
    0:no shift in L-R {c |}{res}     2,557         94 {txt}{c |}{res}     2,651 
                      {txt}{c |}{res}     96.45       3.55 {txt}{c |}{res}    100.00 
                      {txt}{c |}{res}     98.84      38.52 {txt}{c |}{res}     93.64 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
       1:shift in L-R {c |}{res}        30        150 {txt}{c |}{res}       180 
                      {txt}{c |}{res}     16.67      83.33 {txt}{c |}{res}    100.00 
                      {txt}{c |}{res}      1.16      61.48 {txt}{c |}{res}      6.36 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
                Total {c |}{res}     2,587        244 {txt}{c |}{res}     2,831 
                      {txt}{c |}{res}     91.38       8.62 {txt}{c |}{res}    100.00 
                      {txt}{c |}{res}    100.00     100.00 {txt}{c |}{res}    100.00 

{txt}          Pearson chi2({res}1{txt}) = {res} 1.4e+03  {txt} Pr = {res}0.000
{txt}               Cram{c e'}r's V = {res}  0.6937
{txt}
{com}. 
. **Association between SOLS change and DPI's non-economic ideology shift
. gen othershifts = 0 
{txt}
{com}. replace othershifts = 1 if nat_shift==1
{txt}(76 real changes made)

{com}. replace othershifts = 1 if rural_shift==1
{txt}(17 real changes made)

{com}. replace othershifts = 1 if reg_shift==1
{txt}(9 real changes made)

{com}. replace othershifts = 1 if rel_shift==1  
{txt}(69 real changes made)

{com}. tab othershifts if econ_shift==0 & solschdum==1 & _m==3 & (year<2008 & year>=1975)  

{txt}othershifts {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}         85       90.43       90.43
{txt}          1 {c |}{res}          9        9.57      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}         94      100.00
{txt}
{com}.                         
. *** TABLE III: Comparison of DPI and CHISOLS, 1975-2007
. ** Association between SOLS change and DPI's economic ideology shift  
. tab econ_shift solschdum if _m==3 & (year<2008 & year>=1975) , row 
{txt}
{c TLC}{hline 16}{c TRC}
{c |} Key{col 18}{c |}
{c LT}{hline 16}{c RT}
{c |}{space 3}{it:frequency}{col 18}{c |}
{c |}{space 1}{it:row percentage}{col 18}{c |}
{c BLC}{hline 16}{c BRC}

       Shift in Chief {c |}
            Executive {c |} Dummy for solschange
       Party:Economic {c |}         0          1 {c |}     Total
{hline 22}{c +}{hline 22}{c +}{hline 10}
  -999: no info or NA {c |}{res}     1,857        101 {txt}{c |}{res}     1,958 
                      {txt}{c |}{res}     94.84       5.16 {txt}{c |}{res}    100.00 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
    0:no shift in L-R {c |}{res}     2,557         94 {txt}{c |}{res}     2,651 
                      {txt}{c |}{res}     96.45       3.55 {txt}{c |}{res}    100.00 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
       1:shift in L-R {c |}{res}        30        150 {txt}{c |}{res}       180 
                      {txt}{c |}{res}     16.67      83.33 {txt}{c |}{res}    100.00 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
 999: shift no t/f L- {c |}{res}        56        108 {txt}{c |}{res}       164 
                      {txt}{c |}{res}     34.15      65.85 {txt}{c |}{res}    100.00 
{txt}{hline 22}{c +}{hline 22}{c +}{hline 10}
                Total {c |}{res}     4,500        453 {txt}{c |}{res}     4,953 
                      {txt}{c |}{res}     90.85       9.15 {txt}{c |}{res}    100.00 

{txt}
{com}.  
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\nmatsumura\Desktop\MLM Replication\MattesLeedsMatsumuraJPRReplication_Nov2015_3-4.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}25 Nov 2015, 18:46:13
{txt}{.-}
{smcl}
{txt}{sf}{ul off}